package com.jeff.rps;

public enum Throw
{
	SCISSORS, ROCK, PAPER;

	public boolean beats(Throw other)
	{
		if (other == null)
			return true;

		switch (this)
		{
		case SCISSORS:
			return PAPER.equals(other);
		case ROCK:
			return SCISSORS.equals(other);
		case PAPER:
			return ROCK.equals(other);
		default:
			return false;
		}
	}
}
